pimpas.AJAX.Control = Class.create( );
pimpas.Extends(pimpas.AJAX.Control.prototype, pimpas.Object);
pimpas.Extends(pimpas.AJAX.Control.prototype, pimpas.Listener.prototype);
pimpas.Extends(pimpas.AJAX.Control.prototype,
	{
	element: null,
	initialize: function(el) {
		this.element = pimpas.DOM.getElement( el );
	},
	toString: function() {                                             
		return "[AJAX CONTROL LISTENER]";
	},
	callBack: function(obj, evt, text, xml) {
		switch(evt) {
			case pimpas.HTTPRequest.events.onInitialize:
				pimpas.DOM.toVisible( this.element );
			break;
			
			case pimpas.HTTPRequest.events.onComplete:				
				pimpas.DOM.toHidden( this.element );
			break;
			
			case pimpas.HTTPRequest.events.onError:
				pimpas.DOM.toHidden( this.element );
			break;
			
			case pimpas.HTTPRequest.events.onAbort:
				pimpas.DOM.toHidden( this.element );
			break;
		}
	}
  }
);